package File;

import java.io.File;

public class TestIO {
    public static void main(String[] args) {
//        listAllFile(new File("C:\\Users\\DarknessShadow\\Desktop\\rwkbase"));
        // 开启子线程进行列出处理
        new Thread(()->{
//            File file = new File(File.separator + "Users" + File.separator + "yuisama" + File.separator + "Desktop");
//            listAllFile(file);
            listAllFile(new File("C:\\Users\\DarknessShadow\\Desktop\\rwkbase"));
        },"输出线程").start();
        System.out.println("开始进行文件输出.....");
    }

    public static void listAllFile(File file){

        if (file.isDirectory()) {

            File [] results = file.listFiles();
            for (File result :
                    results) {
                listAllFile(result);
            }

        }else {
            System.out.println("File is a 文件:"+file);
        }
    }
}
